/*
 * JFox - The most lightweight Java EE Application Server!
 * more details please visit http://www.huihoo.org/jfox or http://www.jfox.org.cn.
 *
 * JFox is licenced and re-distributable under GNU LGPL.
 */
package org.dding.msc.services;

import java.io.IOException;
import java.io.Writer;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 每个模块都拥有独立的 VelocityEngine，便于使用相对路径 #parse
 *
 * @author <a href='mailto:jfox.young@gmail.com'>Young Yang</a>
 */
public class TemplateServlet extends HttpServlet {

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String pp="[{"+
		"	name : '父节点1 - 展开',"+
		"	id : 1,"+
		"	open : true,"+
		"	isParent : true,"+
		"	children : [{"+
		"				name : '父节点11 - 折叠',"+
		"				id : 11,"+
		"				click : false,"+
		"				isParent : true"+
		"			}, {"+
		"				name : '父节点12 - 折叠',"+
		"				id : 12,"+
		"				click : false,"+
		"				isParent : true"+
		"			}, {"+
		"				name : '父节点13 - 没有子节点',"+
		"				id : 13,"+
		"				click : false,"+
		"				isParent : true"+
					"}]"+
		"}"+

"]";
//		resp.setHeader('Cache-Control', 'no-cache');
//		String mm="123";
		resp.setContentType("text/html;charset=UTF-8");
		Writer writer=resp.getWriter();
		writer.write(pp);
		writer.flush();
		writer.close();
	}

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	}

}
